﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CubicFWNet.Data.ViewModal
{
    public class InvoiceView
    {
        public System.Guid Id { get; set; }

        public Guid SubId { get; set; }

        public decimal Worth { get; set; }

        /// <summary>
        /// -1:等待出库(等待入库) 1：等待发货 2：等待对账 3:等待寄送发票 4:等待财务应收 5:应收完成
        /// </summary>
        public int Status { get; set; }
        public string Number { get; set; }
        /// <summary>
        /// 1：装车 2：快递
        /// </summary>
        public int Type { get; set; }

        public string ExpNumber { get; set; }
        public string ExpTypeName { get; set; }
        public System.Guid OrderId { get; set; }

        public string OrderNumber { set; get; }

        public string CusNumber { set; get; }

        public Nullable<System.Guid> CreatorId { get; set; }
        public string CreatorName { get; set; }
        public Nullable<System.DateTime> CreateTime { get; set; }
        public DateTime OwnTime { set; get; }
        public System.DateTime ApplyTime { get; set; }
        public System.Guid ApplyId { get; set; }
        public string Memo { get; set; }
        public string DliveryDemand { get; set; }
        public string Carrier { get; set; }
        /// <summary>
        /// 收货单位
        /// </summary>
        public string TakeCompany { get; set; }
        public string Data { get; set; }
        public string SendPeople { get; set; }
        public string ReceivePeople { get; set; }
        public int StoreType { get; set; }
        /// <summary>
        /// 冗余（与Type对应）
        /// </summary>
        public string StoreName { get; set; }
        public System.DateTime DliveryTime { get; set; }
        public System.DateTime ReceivedTime { get; set; }
        /// <summary>
        /// 订单状态
        /// </summary>
        public int OrderStatus { set; get; }

        /// <summary>
        /// 0:发货。 1：取货
        /// </summary>
        public int SendType { get; set; }

        /// <summary>
        /// 0:发货单  1：采购的运输单
        /// </summary>
        public int SendCardType { get; set; }

        public string StatusStr
        {
            get
            {
                if (Status == -1)
                {
                    return "等待出库";
                }
                if (Status == 1)
                {
                    return "等待发货";
                }
                if (Status == 2)
                {
                    return "等待对账";
                }
                if (Status == 3)
                {
                    return "等待寄送发票";
                }
                if (Status == 4)
                {
                    return "等待财务应收";
                }
                if (Status == 5)
                {
                    return "应收完成";
                }
                return "";
            }
            set { this.StatusStr = value; }
        }
    }
}
